<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *订单管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$tabs=array(
	array('op'=>'list','title'=>'全部蛋鸡'),
); 
if($_RQ['op']=='list'){
	$return['params']=array();
	$params=array('uniacid'=>$_SESSION['uniacid']);
	if($_RQ['status']){
		$params['status']=intval($_RQ['status']);
		$return['params']['status']=intval($_RQ['status']);
	}
	if($_RQ['mid']){
		$params['mid']=intval($_RQ['mid']);
		$return['params']['mid']=intval($_RQ['mid']);
	}
	$pindex = max(1, intval($_RQ['page']));
	if($_RQ['psize']){
		$_SESSION['psize']=$_RQ['psize'];
	}
	$psize = $_SESSION['psize']?:10;
	$list=pdo_getslice('jy_nongren_myji',$params,array($pindex,$psize),$total,$fields,'','id desc');
	if($list){
		foreach($list as $k=>&$item){
			$item['member']=cfc('core')->member_show($item['mid']);
		}
	}
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>$tabs,
		'list'=>array('data'=>'list','total'=>$total,'psize'=>$psize,'edit'=>false,'del_one'=>false,'delall'=>false,'list'=>array(
			array('name'=>'member','title'=>'拥有者','type'=>'member'),
			array('name'=>'sn','title'=>'编号','type'=>'string'),
			array('name'=>'title','title'=>'蛋鸡名称','type'=>'string'),
			array('name'=>'lsday','title'=>'喂投天数','type'=>'string'),
			array('name'=>'lsfee','title'=>'已喂粮食','type'=>'string'),
			array('name'=>'jd','title'=>'已生鸡蛋','type'=>'string'),
			array('name'=>'price','title'=>'购买价格','type'=>'string'),
			array('name'=>'step','title'=>'阶段','type'=>'radio','options'=>'step'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'status'),
			array('name'=>'isweitou','title'=>'是否委托','type'=>'radio','options'=>'isweitou'),
			array('name'=>'weitime','title'=>'最近喂养时间','type'=>'time'),
			array('name'=>'createtime','title'=>'时间','type'=>'time'),
		)),
		'search'=>array(
			array('name'=>'status','width'=>15,'title'=>'状态','type'=>'radio','options'=>'status'),
			array('type'=>'choose','width'=>15,'action'=>'core/member.get_member/','name'=>'mid','title'=>'选择会员'),
		),
	);
	$return['status']=$this->myji_status;
	$return['step']=$this->myji_step;
	$return['isweitou']=array('未委托喂养','已委托喂养');
	$return['htmls']=$htmls;	
	exi($return);
}
